package com.sunjy.common.utils;

/**
 * 用来mask诸如身份证号，手机号码等敏感信息的工具类
 *
 * Created by Louis on 2017/7/6.
 */
public class SensitiveMaskUtils {
    public static String replaceIdCard(String idCard){
        return  idCard.substring(0,6)+"*********"+idCard.substring(14);
    }

    public static String maskPhoneNumber(String phoneNumber){
        return phoneNumber.substring(0,3) + "****" + phoneNumber.substring(7);
    }

    public static void main(String[] args){
        System.out.println(maskPhoneNumber("18217267935"));
    }
}
